home *** CD-ROM | disk | FTP | other *** search
- (*----------------------------------------------------------------------*)
- (* InitTerm --- Initialize PibTerm *)
- (*----------------------------------------------------------------------*)
-
- PROCEDURE InitTerm;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Procedure: InitTerm *)
- (* *)
- (* Purpose: Initializes PibTerm *)
- (* *)
- (* Calling Sequence: *)
- (* *)
- (* InitTerm; *)
- (* *)
- (* Calls: *)
- (* *)
- (* INt24On *)
- (* Set_Defaults *)
- (* InitOvly *)
- (* Read_Config_File *)
- (* MyLoadOverlay *)
- (* TestVersionWarning *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- VAR
- I : INTEGER;
-
- BEGIN (* InitTerm *)
- (* Initialize critical error *)
- (* handler routine. *)
- Int24ON;
- (* Initialize handler for *)
- (* other errors. *)
- ErrorPtr := OFS( Trap_Error );
- (* Indicate that no modules *)
- (* are currently loaded. *)
- FOR I := 1 TO MaxNumModules DO
- ModuleLoaded[I] := -99;
- (* Get config file directory *)
- InitOvly;
- (* See if parameter reader can be loaded *)
- (* And also parameter setter *)
-
- IF ( ( NOT MyLoadOverlay( 0, PT4SETP, 'PT4SETP.CHN' ) ) OR
- ( NOT MyLoadOverlay( 1, PT4INIT, 'PT4INIT.CHN' ) ) ) THEN
- BEGIN
- WRITELN('*** PibTerm cannot be initialized.');
- WRITELN('*** Program stops.');
- Halt( 1 );
- END;
- (* Display message if this is *)
- (* a test version. *)
- IF Test_Version THEN
- Test_Version_Warning;
- (* Determine if multitasker active *)
- (* Also sets 'Multitasker' telling *)
- (* which multitasker is active *)
-
- TimeSharingActive := IsTimeSharingActive;
-
- (* Redirect keyboard input to *)
- (* PibTerm's special driver *)
- Keyboard_Buffer[0] := #0;
- ConInPtr := OFS( Keyboard_Reader );
-
- (* Get current interrupt 9 address *)
-
- DOS_Get_Intrpt( Kbd_Interrupt , Kbd_Save_Iaddr1, Kbd_Save_Iaddr2 );
-
- (* Get current interrupt $10 address *)
-
- DOS_Get_Intrpt( Video_Interrupt , Video_Save_Iaddr1, Video_Save_Iaddr2 );
-
- (* And initialize the global variables *)
- Set_Defaults;
- (* Read or create primary config. file *)
-
- IF ( NOT Read_Config_File ) THEN
- BEGIN
- Get_Default_Params( TRUE );
- Write_Config_File('');
- END;
- (* Allocate dialing directory, *)
- (* review buffer. *)
- Allocate_Dial_And_Review;
- (* Read in directory, function keys, etc. *)
- Get_Other_Files;
- (* Ensure code segment variables updated *)
-
- CloneCodeSegment( TurboRunDataStart , TurboRunDataLength );
-
- (* Set other parameters *)
- Set_Other_Parameters;
- (* Clear out command line area. *)
- Mem[CSeg:$80] := 0;
- Mem[CSeg:$81] := ORD( CR );
- (* Initialize communications *)
- Initialize_Communications;
-
- END (* InitTerm *);